/* eslint valid-jsdoc: "off" */

"use strict";

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = (appInfo) => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {});

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + "_1611630725660_9327";

  // add your middleware config here
  config.middleware = [];

  // 模板渲染
  config.view = {
    mapping: {
      ".html": "nunjucks",
    },
  };

  // 文件上传file模式
  config.multipart = {
    mode: "file",
  };

  // 关闭csrf
  config.security = {
    csrf: false,
  };

  // 数据库连接sequelize
  config.sequelize = {
    dialect: "postgres", // support: mysql, mariadb, postgres, mssql
    connectionUri:
      "postgresql://tencentdb_nmyom7vv:G1lW45%5DQKmp%23)q6@postgres-nmyom7vv.sql.tencentcdb.com:53518/tencentdb_nmyom7vv",
  };

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
